<template>
  <div class="greenhouse-info">
    <div class="info-wrapper">
      <!-- 标题和ID -->
      <div class="info-title">
        <span class="gh-id">#GH-001</span>
        <span class="gh-name">智能温室1号</span>
        <span class="gh-status">运行中</span>
      </div>

      <!-- 主要数据 -->
      <div class="main-stats">
        <div class="stat-row">
          <div class="stat-col">
            <div class="stat-label">占地面积</div>
            <div class="stat-value">1000<span class="unit">㎡</span></div>
          </div>
          <div class="stat-col">
            <div class="stat-label">投入使用</div>
            <div class="stat-value">365<span class="unit">天</span></div>
          </div>
        </div>
        <div class="stat-row">
          <div class="stat-col">
            <div class="stat-label">在线设备</div>
            <div class="stat-value">6<span class="unit">台</span></div>
          </div>
          <div class="stat-col">
            <div class="stat-label">运行时长</div>
            <div class="stat-value">168<span class="unit">h</span></div>
          </div>
        </div>
      </div>

      <!-- 详细信息 -->
    </div>
  </div>
</template>

<style scoped>
.greenhouse-info {
  height: 100%;
  width: 100%;
  padding: 5px;
}

.info-wrapper {
  height: 100%;
  background: rgba(14, 36, 82, 0.4);
  border: 1px solid rgba(126, 198, 153, 0.1);
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 标题样式 */
.info-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(126, 198, 153, 0.1);
}

.gh-id {
  font-size: 13px;
  color: #7ec699;
  opacity: 0.8;
}

.gh-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.gh-status {
  padding: 2px 6px;
  font-size: 12px;
  color: #67c23a;
  background: rgba(103, 194, 58, 0.1);
  border: 1px solid rgba(103, 194, 58, 0.2);
  border-radius: 10px;
  margin-left: auto;
}

/* 主要数据样式 */
.main-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.stat-col {
  flex: 1;
  background: rgba(14, 36, 82, 0.6);
  border-radius: 4px;
  padding: 8px;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  color: #7ec699;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 16px;
  color: #fff;
  font-weight: 500;
}

/* 详细信息样式 */
.detail-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  font-size: 13px;
  color: #7ec699;
  padding-left: 8px;
  border-left: 3px solid #7ec699;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-label {
  font-size: 12px;
  color: #7ec699;
  white-space: nowrap;
}

.detail-value {
  font-size: 12px;
  color: #fff;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit {
  font-size: 12px;
  color: rgba(126, 198, 153, 0.6);
  margin-left: 2px;
}

/* 响应式调整 */
@media screen and (max-width: 1600px) {
  .info-wrapper {
    gap: 10px;
    padding: 8px;
  }
  
  .stat-value {
    font-size: 15px;
  }
}

@media screen and (max-width: 1366px) {
  .greenhouse-info {
    padding: 4px;
  }
  
  .info-wrapper {
    gap: 8px;
    padding: 6px;
  }
  
  .stat-value {
    font-size: 14px;
  }
  
  .detail-grid {
    gap: 6px;
  }
}
</style> 